package com.bzframework.pro.authorize.token.generator;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
 * @Author bingzhong
 * @Date 2024/11/29 10:49
 * @Description
 */
public class Md5PasswordGenerator implements PasswordGenerator {
    @Override
    public String generateEncryptedPassword(String password, String salt) {
        return DigestUtils.md5DigestAsHex(
                String.format("%s:%s", password, salt)
                      .getBytes(StandardCharsets.UTF_8));
    }
}
